package fat
{

import com.fit4as.fit.*;

public class HtmlToTextFixture extends ColumnFixture
{
    public var HTML : String;

    public function Text() : String {
        HTML = HTML.replace(/\\u00a0/g, "\u00a0");
        return escapeAscii(Parse.htmlToText(HTML));
    }

    private function escapeAscii(text : String) : String {
        text = text.replace(/\n/g, "\\n");
        text = text.replace(/\r/g, "\\r");
        text = text.replace(/\\u00a0/g, "\\\\u00a0");
        return text;
    }
}
}